<?php

class Core_Controller_Admincp_Storage_Index extends Nuo_Controller_Admincp
{

	function execute($request)
	{
		Nuo::setVar('breadcrum', array(
			'title' => 'Storage System',
			'toolbar' => 'admincp/core/storage',
		));


		$storageTable = Nuo::getTable('core/storage');
		$typeTable = Nuo::getTable('core/storage/type');

		$select = $storageTable -> select() -> from(array('s' => $storageTable -> getName()));
		$select-> joinLeft(array('t' => $typeTable -> getName()), 't.type_id  = s.type_id');

		$items = $storageTable -> fetchAll($select);

		return $this -> render($data = array('items' => $items));
	}

}
